# == Class setproxy::config
#
# This class is called from setproxy
#
class setproxy::config {
  case $::osfamily {
    'Debian': {
      class { 'apt':
        proxy_host => $setproxy::proxy,
        proxy_port => $setproxy::proxyport,
      }
    }
    'windows': {
      $proxystring = "${setproxy::proxy}:${setproxy::proxyport}"
      exec { 'setwinproxy':
        path    => $::path,
        command => "netsh winhttp set proxy ${proxystring}",
        unless  => "cmd.exe /c \"netsh.exe winhttp show proxy | findstr.exe \"${proxystring}\"\"",
      }
    }
    default: {
      fail("${::osfamily} not supported")
    }
  }
}
